package com.alan.edu.mybatis.sqlsession;

import com.alan.edu.mybatis.pojo.Configuration;
import com.alan.edu.mybatis.pojo.MappedStatement;

import java.sql.SQLException;
import java.util.List;

/**
 * 自定义执行器
 *
 * @author alan
 * @date 2020-08-31 23:17:35
 */
public interface Executor {

    /**
     * 查询
     *
     * @param configuration
     * @param mappedStatement
     * @param params
     * @param <E>
     * @return
     * @throws Exception
     */
    public <E> List<E> query(Configuration configuration, MappedStatement mappedStatement, Object... params) throws Exception;

    /**
     * 更新
     *
     * @param configuration
     * @param ms
     * @param parameter
     * @return
     * @throws Exception
     */
    public int update(Configuration configuration, MappedStatement ms, Object... parameter) throws Exception;

}
